package com.erbao.dp.singleton;

/**
 * @author CaoBaoYin
 * @since 21/8/22 09:27
 */
public class Manager05 {
    private static Manager05 manager05;

    private Manager05() {
    }

    public static synchronized Manager05 getInstance(){
        if (manager05 == null) {
            // 无法做到线程安全，一个线程执行完，另一个线程获取到锁，会执行创建对象
            synchronized (Manager05.class) {
                manager05 = new Manager05();
            }
        }
        return manager05;
    }
}
